import Vue from 'vue'
import App from './App.vue'
import router from './router/router'
import store from './store'

import 'ant-design-vue/dist/antd.css'
import './style/index.less'
import configFun1 from './common/common'
Vue.prototype.configFun = configFun1;
import Antd from 'ant-design-vue'
import axios from 'axios'

import echarts from 'echarts'

Vue.config.productionTip = false
Vue.use(Antd)
Vue.prototype.$axios = axios
import '@/icons'
Vue.prototype.$echarts = echarts
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
Vue.use(Viewer)
//图片放大
Viewer.setDefaults({
  Options: { 'inline': false, 'button': true, 'navbar': true, 'title': false, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': false, 'url': 'data-source' }
})

import nprogress from 'nprogress'
import 'nprogress/nprogress.css'

import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'

import 'lib-flexible'

Vue.use(VXETable)





//限制输入框小数点位数
Vue.directive('enterNumber', {
  inserted: function(el) {
    el.addEventListener("keypress", function(e) {
      e = e || window.event;
      let charcode = typeof e.charCode == 'number' ? e.charCode : e.keyCode;
      let re = /\d/;
      if (!re.test(String.fromCharCode(charcode)) && charcode > 9 && !e.ctrlKey) {
        if (e.preventDefault) {
          e.preventDefault();
        } else {
          e.returnValue = false;
        }
      }
    });
  }
});

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
